<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
use think\facade\Route;

/** province 开始 **/
Route::group("provinces",function() {
    Route::get("all","Province/index");
});
/** province 结束 **/

Route::group("charts",function() {
    Route::get("index","Chart/index");
    Route::get("lists","Chart/lists");
})->pattern(['id' => '[0-9]+']);

Route::group("common",function() {
    Route::get("province","Common/province");
    Route::get("city","Common/city");
    Route::get("area","Common/area");
})->pattern(['id' => '[0-9]+']);

/** 题库 **/
Route::group("questions",function() {
    Route::get("index","Question/index");
    Route::post("answer","Question/answer");
})->pattern(['id' => '[0-9]+']);
/** 题库 **/

/** 福利 **/
Route::group("welfares",function() {
    Route::get("linkers","Welfare/linkers");
    Route::get("goods","Welfare/goods");
    Route::post("click/:id","Welfare/click");
})->pattern(['id' => '[0-9]+']);
/** 福利 **/

/** 用户 **/
Route::group("users",function() {
    Route::get("show","User/detail");
    Route::post("update","User/update");
    Route::post("wxauth","User/wxauth");
    Route::post("wxlogin","User/wxlogin");
    Route::post("getphone","User/getPhone");
    Route::get("creditlists","User/creditLists");
    Route::post("credit/donate","UserCredit/donate");
    Route::get("answerlists","User/answerLists");
    Route::get("donatelists","User/donateLists");
})->pattern(['id' => '[0-9]+']);
/** 用户 **/

/** 组织 **/
Route::group("organizations",function() {
    Route::get("lists","Organization/lists");
})->pattern(['id' => '[0-9]+']);
/** 组织 **/

/** 活动 **/
Route::group("activities",function() {
    Route::get("lists","Activity/lists");
    Route::get(":id","Activity/detail");
    Route::post("signup","ActivityEnlist/add");
})->pattern(['id' => '[0-9]+']);
/** 活动 **/

/** 用户地址 **/
Route::group("users/address",function() {
    Route::get("lists","UserAddress/index");
    Route::get(":id","UserAddress/detail");
    Route::post(":id","UserAddress/update");
    Route::post("add","UserAddress/add");
    Route::post("delete/:id","UserAddress/delete");
    Route::post("default/:id","UserAddress/default");
    Route::get("getdefault","UserAddress/getDefaultAddress");
})->pattern(['id' => '[0-9]+']);
/**  **/

Route::group("orders",function() {
    Route::get("lists","Order/index");
    Route::post("add","Order/add");
    Route::get("detail","Order/detail");
    Route::post("cancel","Order/cancel");
    Route::post("preview","Order/preview");
    Route::post("receive","Order/receive");
})->pattern(['id' => '[0-9]+']);

Route::group("gdzyz",function() {
    Route::get(":id","Gdzyz/detail");
    Route::get("schoollist","Gdzyz/schoolList");
    Route::get("school/:id","Gdzyz/mission");
})->pattern(['id' => '[0-9]+']);

/** 组织 **/
Route::group("test",function() {
    Route::get("index","Test/index");
});
/** 组织 **/

/** linkers 开始 **/
Route::group('linkers',function () {
    Route::get('lists', 'Linker/lists');
})->pattern(['id' => '[0-9]+']);
/** linkers 结束 **/